package top.wugy.blog.searcher;

import top.wugy.blog.kits.BlogKit;

import java.io.Serializable;
import java.util.Date;

public class SearcherBean implements Serializable {

    private int id;
    private String title;
    private String tag;
    private String content;
    private String createTime;

    private SearcherBean() {
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getTag() {
        return tag;
    }

    public void setTag(String tag) {
        this.tag = tag;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }


    public static final class Builder {

        private static SearcherBean bean;

        public Builder() {
            bean = new SearcherBean();
        }

        public Builder setId(Integer id) {
            bean.setId(id);
            return this;
        }

        public Builder setTitle(String title) {
            bean.setTitle(title);
            return this;
        }

        public Builder setTag(String tag) {
            bean.setTag(tag);
            return this;
        }

        public Builder setContent(String content) {
            bean.setContent(content);
            return this;
        }

        public Builder setCreateTime(Date createTime) {
            bean.setCreateTime(BlogKit.date2Str(createTime));
            return this;
        }

        public SearcherBean build() {
            return bean;
        }
    }
}
